#ifndef __TYPES_H__
#define __TYPES_H__

typedef bit				BIT;
typedef unsigned char	BOOL;
typedef signed   char	INT8;
typedef unsigned char	UINT8;
typedef signed short	INT16;
typedef unsigned short	UINT16;
typedef signed long		INT32;
typedef unsigned long	UINT32;
typedef float			FLOAT;

#define NULL			((void *) 0)
#define FALSE			0x00
#define TRUE			0x01

#define BIT_0			0x01
#define BIT_1			0x02
#define BIT_2			0x04
#define BIT_3			0x08
#define BIT_4			0x10
#define BIT_5			0x20
#define BIT_6			0x40
#define BIT_7			0x80

/*
#define BIT_8    		0x0100
#define BIT_9			0x0200
#define BIT_10			0x0400
#define BIT_11			0x0800
#define BIT_12			0x1000
#define BIT_13			0x2000
#define BIT_14			0x4000
#define BIT_15			0x8000
*/

typedef void (*INTERRUPT_HANDLE_T)(void *p_param);

#if 1
#define _REENTRANT_		  reentrant
#else
#define _REENTRANT_
#endif

///////////////////////////////////////////////////////////////////////////

#define SET_BIT(byte_reg, mask, val) \
{ \
	if (val == 0) \
	{\
		byte_reg &= (UINT8)(~(mask)); \
	}\
	else \
	{\
		byte_reg |= (UINT8)(mask); \
	}\
}

///////////////////////////////////////////////////////////////////////////
//#define _DBG_
#ifdef _DBG_
#define DBG_ASSERT(statement) \
	do\
	{\
		if(!(int)(statement))\
		{\
			while(1); \
		}\
	} while(0)
#else
#define DBG_ASSERT(statement)
#endif	/* _DBG_ */

#endif
